Focus Magic Help Contents
   Focus Magic

Introduction

Focusing Filter

Defocusing Filter

Increase Resolution Filter

Despeckle Filter


Introduction

What Focus Magic can do

Focus Magic consists of a set of image restoration filters which can :-

a)  Refocus (sharpen) an image which is blurred.

b)  Defocus (soften) an image by varying amounts

c)  Increase the resolution of an image which has too few pixels to print with smooth edges.

d)  Despeckle an image which has been scanned in.

Although there are many image editing programs with a “Sharpen” feature, none of the one’s we have seen, come anywhere close to the re-focusing capabilities of Focus Magic.  The Increase Resolution filter uses ground breaking technology to get rid of the pixelised look of images which have a low resolution.

Computer Requirements

To recover the original image Focus Magic needs to do an enormous amount of processing.  A small image may take a few minutes, and a large image may take more than a hour.   All the number crunching routines have been written in assembler for maximum speed.   Focus Magic also needs quite a lot of memory (about 20 bytes of free memory per pixel).  A one megapixel picture would therefore require 20 MB of free RAM.

Image Requirements

If you have an image which is out of focus, the accuracy of the color of each pixel is important, especially as the image gets more out of focus.  Scan and save your images with the highest quality possible.  If you are scanning in a photo, please wipe the dust off first.

JPEG Files

Focus Magic can currently only read and write JPEG files (because that is the most popular format).   If you have the ability to save your .jpg images with different compression amounts, then use the lowest level of compression (ie. the highest accuacy).  When Focus Magic saves a file it uses low compression (high accuracy).


Focusing Filter

Images can get blurred because :-

a)  The camera was out of focus when the picture was taken

b)  The camera or subject were moving when the picture was taken

c)  The image was softened (de-focused) using software

d)  The scanner used to scan the image doesn’t have a high enough resolution.

Focus Magic can correct blurred images caused by any of these conditions.   Although there are many image editing programs with a “Sharpen” feature, none of the one’s we have seen, come anywhere close to the focusing capabilities of Focus Magic.  Where most sharpen filters use an amount of about 3, Focus Magic can sharpen with amounts of up to 40.

Example 1  -  Fixing an image which is out of focus

               Before                            After

This image of a girl’s ear was re-focused using an Amount of 20 and a Medium Filter to produce the image on the right.

Example 2  -  Fixing motion blur

               Before                           After

With this image the camera was moved in a direction shown by one of the arrows.  Edges which go in the same direction are in focus (eg. the top left hand edge of the dome at the top of the hat), but all other edges have a double edge.  This image was fixed using an Amount of 11 and a Medium Filter to produce the image on the right.

Refocusing Procedure

There are 5 steps to re-focus an image :-

Step 1 - Start with the best image you can

The more pixels you give Focus Magic to work with, and the more accurately the color of each pixel is defined, the better the result.  Wipe the dust off the photo before scanning it in, scan it in with a high resolution (bpi), edit out bits of dirt, save the JPEG file with low compression (high accuracy), etc.  If you have Adobe Photoshop or Paint Shop Pro, you might want to scan it in as a TIFF,  then crop it and save it as a JPEG with minimum compression.

Step 2 - Determine the Amount

In order to reverse the process by which the image got out of focus, Focus Magic firstly needs to know the Amount by which the image is out of focus.  The Amount is the distance that a pixel has spread.  To determine the Amount, open the image with a program such as PhotoShop, zoom in at an edge which is blurred, and count the pixels from where the blur starts to where the blur finishes.  In the example below, the blurred edge spans about 11 pixels as shown by the red dots.  If you are not sure exactly where the blur starts and where it finishes, then err on the high side.  In some images, you can determine the Amount the scientific way.

Step 3 - Previewing the Result

Once you have entered the amount, you can preview the filter with small test areas on the image.  Simply click on an area that you want to focus.  Focus Magic will focus that small area using the current filter settings.  Adjust the Amount up or down until you get the best result.  Changing the Amount, automatically updates the preview.

Step 4 - Selecting a Focusing Filter

Once you have determined the most suitable Amount, select the most appropiate focusing filter (the ‘With’ value).  This would simply be done by trial and error on one or more test areas of the image.  Simply click on an area of interest and try softer or harder focusing filters until you get the best result.

A harder filter will focus the image more, but can also distort the image more.  A softer filter will focus the image less, but will also distort it less.

The extent to which an image can be refocused depends very much on the accuracy of the color of each pixel.  Generally speaking, images for which the color of each pixel is accurately defined can use harder filters.  Grainy images need softer filters.

The medium focusing filter is suitable for most images.

Examples of different focusing filters

         Original                  Soft Filter             Med. Soft Filter      Medium Filter       Med. Hard Filter        Hard Filter

Step 5 - Focusing the Image

Once you have done some spot checks on the image you can press the green traffic light button to focus the whole image.  There is a huge amount of number crunching to do, which can take from a few minutes to over an hour.  Focus Magic has been designed to run in the backgound, so provided you are not running low on memory, you can use your computer for something else while the image is being focused.

If you want to abort the image processing, simply press the red traffic light.

PhotoShop is a trademark of Adobe and all other trademarks are owned by their respective owners.


Determining the Amount - Scientific
Scientific Way of Determining the Amount

The Amount is really the Diameter of the circle to which a single pixel spreads when it goes out of focus.  If you are lucky enough to have a point source in your image, then you can use it to determine the Amount exactly.

Locating a Point Source

A point source is a small bright source of light.  It would idealy only occupy one pixel (when focused).  When it gets out of focus, it creates a circle with reasonably well defined edges.  A point source with a diameter of more than one pixel produces a circle with blurred edges.  Sometimes it produces a hexagonal or octoganal shape if that is the shape of the aperture mechanism in the camera.

Point sources come mostly from light glinting off shiny objects such as a persons eyes, a persons glasses, a bottle, etc.

Example 1

This medicine bottle in the background of a photo has light glinting off it.  This is a point source which has become a circle when it became out of focus.  The image on the right has zoomed into that point source, and shows that the diameter is about 18 (distance between black dots).

Note that we have placed the black dots approximately in the middle of the blurred edges (ie. between the blue dots).  To zoom into the image, you need to use another program such as PhotoShop or Paint Shop Pro.

Example 2

This image of some trees in the background of a photo has a point source.  Can you see it ?

Example 3

Sometimes you can have a point source bonanza as shown here.  This is some light shining through holes in trees from the same photo as the previous one.

PhotoShop is a trademark of Adobe and all other trademarks are owned by their respective owners.


Defocusing Filter

You can defocus (blur or soften) an image by varying amounts (up to 40).

Example

           Original                   Amount = 3                 Amount = 6              Amount = 12

You can preview the effect of the defocusing filter by clicking on the image.


Increase Resolution Filter

The most common use of this filter is to increase the resolution of images taken with a low resolution digital camera, or from the internet.

Example

  Before     Intermediate            After

The “Increase Resolution” filter first doubles (or quadruples) the width and height of the image to produce the intermediate image, and then uses advanced interpolation techniques to remove the “pixelised” effect.

There are four different filter types - No Filter, Medium Filter, Medium Soft Filter and Soft Filter.  The default is the Medium Filter.  If you have a high quality picture, you can choose No Filter.  If you have a low quality picture, you need to choose a Softer Filter.


Despeckle Filter

The despeckle filter is used to soothen an image which has been scanned in from a magazine, newspaper, etc.  Scan the image in with a resolution high enough that you can see the individual speckles (dots).  Count the distance between the dots, and enter that into the Dot Pitch in Focus Magic before running the filter.

Example

           Before                       After

The despeckle filter here was run with a dot pitch (distance between dots) of 5.

The speckles in images often look like circles (as shown here), but if you zoom in enough they are actually dots (as shown below).

Determining the Dot Pitch

Use a program such as Photoshop to zoom into the image and count the distace between the dots.  In this example the dot pitch is about 6.

If this all sounds too technical, just click on an area of the image to preview the filter, and adjust the Dot Pitch parameter to suit.

PhotoShop is a trademark of Adobe and all other trademarks are owned by their respective owners.


   Tutorial

Before using Focus Magic, please spend a few minutes on this tutorial so that you know how to refocus an image.

The test image (placed in C:\My Documents\My Pictures) can be re-focused as follows:-

1)  Select the “Focus” filter on the toolbar.

2)  Select an Amount of 10.  The Amount specifies the distance to which a pixel has spread, and it is important to get it approximately correct.  For your own images, you can determine the Amount here.

3)  Click on the image (eg. on an eye) for a thumbnail preview of what Focus Magic would do.

4)  Try different focusing filters (“With” values) from the toolbar to see the effect of harder and softer filters.

5)  When you are happy with the “Amount” and the “Focusing Filter”, then focus the whole image by pressing the green traffic light.

You can press the yellow question mark at any time for more help on the filter you are using.

To re-display this tutorial, simply open the test image.